<?php
namespace Home\Controller;
use Think\Controller;
class CateController extends CommonController {
    public function cate(){
      $article=D('article');
      $count=$article->where(array('cateid' =>I('get.id')))->count();
      $Page=new \Think\Page($count,1);
      $show=$Page->show();
      $list=$article->where(array('cateid'=>I('get.id')))->order('time desc')->limit($Page->firstRow.','.$Page->listRows)->select();
      $this->assign('list',$list);// 赋值数据集
      $this->assign('page',$show);// 赋值分页输出
      $this->display();
    }
}
